package com.ihighest.app.infox.fragment;

import org.json.JSONArray;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.ihighest.app.infox.R;
import com.ihighest.app.infox.adapter.PlantRightListViewAdapter;

/**
 * 填充种植百科右侧的空间
 * 
 * @author Administrator Created at 2015-10-13 下午5:34:16
 * @version 1.0
 */
public class PlantFragment extends Fragment {

	View view;
	Context context;
	ListView plantListView;

	JSONArray array;

	public PlantFragment(Context context, JSONArray array) {
		super();
		this.context = context;
		this.array = array;
	}

	@SuppressLint("InflateParams")
	@Override
	@Nullable
	public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.infox_fragment_plant, null);

		plantListView = (ListView) view.findViewById(R.id.id_plant_rightlistview);

		PlantRightListViewAdapter adapter = new PlantRightListViewAdapter(context, array);
		plantListView.setAdapter(adapter);
		adapter.notifyDataSetChanged();

		return view;
	}

}
